// custom-tab-bar/index.js
Component({
    /**
     * 组件的属性列表
     */
    properties: {

    },

    /**
     * 组件的初始数据
     */
    data: {
        list: [
            {
                pagePath: '/pages/index/index',
                text: '推荐',
                iconPath: '/image/tabbar/recommend.png',
                selectedIconPath: '/image/tabbar/recommend_active.png'
            },
            {
                pagePath: '/pages/all/all',
                text: '全部',
                iconPath: '/image/tabbar/all.png',
                selectedIconPath: '/image/tabbar/all_active.png'
            },
            {
                pagePath: '/pages/welfare/welfare',
                text: '福利',
                iconPath: '/image/tabbar/welfare.png',
                selectedIconPath: '/image/tabbar/welfare_active.png'
            },
            {
                pagePath: '/pages/profile/profile',
                text: '我的',
                iconPath: '/image/tabbar/profile.png',
                selectedIconPath: '/image/tabbar/profile_active.png'
            }
        ],
        selected: null
    },

    /**
     * 组件的方法列表
     */
    methods: {
        switchTab(e) {
            let url = e.currentTarget.dataset.url
            wx.switchTab({
              url
            })
        }
    }
})
